package com.foreknow.service.impl;

import com.foreknow.dao.RegistlevelMapper;
import com.foreknow.entity.Registlevel;
import com.foreknow.service.RegistlevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RegistlevelServiceImpl implements RegistlevelService {
    @Autowired
    private RegistlevelMapper registlevelMapper;

    /**
     * 查询所有
     * @return
     */
    @Override
    public List<Registlevel> getQueryAllLevel(String query) {
        return registlevelMapper.findLevel(query);
    }



    /**
     * 添加
     * @param
     * @return
     */
    @Override
    public int insertLevel(Registlevel registlevel) {
        return registlevelMapper.insertSelective(registlevel);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @Override
    public int deleteLevel(Integer id) {
        return registlevelMapper.deleteByPrimaryKey(id);
    }

    /**
     * 修改
     * @param
     * @return
     */
    @Override
    public int updateLevel(Registlevel registlevel) {
        return registlevelMapper.updateByPrimaryKey(registlevel);
    }

    /**
     * 根据id查询挂号等级
     * @param id
     * @return
     */
    @Override
    public Registlevel selectLevel(Integer id) {
        return registlevelMapper.selectByPrimaryKey(id);
    }
}